package com.linln.admin.system.controller;

import com.linln.admin.handler.MessageEventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ProjectName: springboot-socketio
 * @Package: com.xncoding.jwt.controller
 * @ClassName: SocketController
 * @Description: java类作用描述
 * @Author: mengxiabing
 * @CreateDate: 2022-05-06 14:14
 * @UpdateUser: 更新者
 * @UpdateDate: 2022-05-06 14:14
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Controller
@RequestMapping("/push")
public class SocketController {

    private static final Logger logger = LoggerFactory.getLogger(MessageEventHandler.class);

    @Autowired
    private MessageEventHandler messageEventHandler;

    @RequestMapping("/send")
    @ResponseBody
    public void sendMsg() {
        logger.info("send Msg....");
        messageEventHandler.sendAllUser();
    }

}
